#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<vector>
#include<cstring>
#include<cmath>
//https://www.luogu.com.cn/problem/P1744
using namespace std;
typedef pair<int, double> PIF;

const int N = 110, M = 1020;



int n, m;
int s, t;

vector<PIF> edges[N];
double dist[N];
struct node
{
	double x, y;
}val[N];

double calc(int a,int b)
{
	double dx = val[a].x - val[b].x;
	double dy = val[a].y - val[b].y;
	return (sqrt(dx * dx + dy * dy));
}


void bf()
{
	for (int i = 1; i <= n; i++) dist[i] = 1e10;
	dist[s] = 0;


	for (int i = 1; i < n; ++i)
	{
		for (int j = 1; j <= n; ++j)
		{
			for (auto& t : edges[j])
			{
				int v = t.first;
				double w = t.second;

				if (dist[j] + w < dist[v])
					dist[v] = dist[j] + w;
			}
		}
	}

}

int main()
{
	cin >> n;
	for (int i = 1; i <= n; ++i)
	{
		cin >> val[i].x >> val[i].y;
	}

	cin >> m;
	for (int i = 1; i <= m; ++i)
	{
		int u, v;
		cin >> u >> v;
		double w = calc(u, v);
		edges[u].push_back({ v,w });
		edges[v].push_back({ u,w });
	}

	cin >> s >> t;

	bf();
	printf("%.2lf\n", dist[t]);
	//cout << dist[t] << endl;


	return 0;
}